package com.e3.basdoc.region.client;

import java.util.ArrayList;
import java.util.List;

import com.e3.basdoc.region.model.RegionModel;
import com.e3.template.tgf.TGFSimpleFormPanel;
import com.extjs.gxt.ui.client.widget.form.Field;

public class RegionFormPanel extends TGFSimpleFormPanel<RegionModel> {

	@Override
	public List<Field<?>> getFormFields() {
		String[] names = { RegionModel.ID, RegionModel.CODE, RegionModel.NAME, RegionModel.PARENT_REGION, RegionModel.ENGLISH_NAME,
				RegionModel.ZIPCODE };
		List<Field<?>> fields = new ArrayList<Field<?>>(names.length);
		for (String name : names) {
			Field<?> formField = RegionHelper.INSTANCE.createFormField(name);
			fields.add(formField);
		}
		return fields;
	}

	@Override
	public RegionModel createModelInstance() {
		return RegionHelper.INSTANCE.createModelInstance();
	}

}
